home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Help / Diff Help < prev    next >
Encoding:
Text File  |  2000-08-24  |  11.1 KB  |  280 lines

  1.  
  2. Diff Help
  3.  
  4.                                                version: 3.3.1
  5.                                                created: 09/04/94 {02:48:19 pm} 
  6.                                            last update: 08/24/00 {01:03:19 pm}
  7.  
  8. _________________________________________________________________
  9.  
  10. INTRODUCTION
  11.  
  12. The diff mode for Alpha has recently been rewritten.  It allows powerful
  13. side-by-side file comparison, including the ability to patch differences
  14. back and forth between the two files.  The main new feature is that making
  15. such patches does not mess up Alpha's understanding of where subsequent
  16. patches should be inserted.
  17.  
  18. Do not attempt to perform more than one diff at the same time.  The arrays
  19. which are used to store information will probably conflict.  This will
  20. ultimately be fixed.
  21.  
  22. The main feature which is lacking is an 'unpatch' feature.  You will have
  23. to make do with Alpha's 'Undo' facility for the moment.  (Basically the
  24. problem is if you patch section 'a', then patch section 'b', you can't undo
  25. 'a' without undoing 'b' first).
  26.  
  27. If you find Diff mode very slow, disable the 'useMarksDontSwitch' flag in
  28. the Diff mode preferences.  
  29.  
  30. The source code can be examined in the file "diffMode.tcl".
  31.  
  32. NEW
  33.  
  34. Diff mode now copes with context-sensitive diffs (using the -C N) option.
  35.  
  36. _________________________________________________________________
  37.  
  38. BASIC USAGE
  39.  
  40. Examine the submenu "Utils --> Compare".  
  41.  
  42. Use compare 'windows' 'files…' or 'directories…' to compare two things. 
  43. Use the cursor keys and return/enter (unless you've set the synchronise
  44. flag in which case return/enter aren't necessary) to move around and
  45. compare the files.
  46.  
  47. Use ctrl-left and ctrl-right to patch changes from one window to the other.
  48.  
  49. You can rerun the diff using the menu.
  50.  
  51. See the "Compare Example", which compares the 'tclMode.tcl' file with the
  52. 'Tcl-Example.tcl' file that resides in the Mode Examples folder.
  53.  
  54.  
  55. ADVANCED USAGE
  56.  
  57. Open any .diff file, locate either the left or right file and you can patch
  58. in changes from the diff window using ctrl-left or ctrl-right as
  59. appropriate.
  60.  
  61. Note: the diff server is 68k so if someone could recompile it for PPC, that
  62. would speed things up a lot.
  63.  
  64. The unix man entry for Diff follows:
  65.  
  66. _________________________________________________________________
  67.  
  68. NAME
  69.      diff - display line-by-line  differences  between  pairs  of
  70.      text files
  71.  
  72. SYNOPSIS
  73.      diff [ -bitw ] [ -c [ # ] | -e | -f | -n | -h  ]   filename1
  74.      filename2
  75.      diff [ -bitw ] [ -Dstring ]  filename1 filename2
  76.      diff [ -bitw ] [ -c [ # ] | -e | -f | -n | -h ] [ -l ] [  -r
  77.      ] [ -s ] [ -Sname ]  directory1 directory2
  78. _________________________________________________________________
  79.  
  80. DESCRIPTION
  81.      diff is a differential file comparator.  When run on regular
  82.      files,  and  when  comparing  text  files that differ during
  83.      directory comparison  (see  the  notes  below  on  comparing
  84.      directories),  diff  tells what lines must be changed in the
  85.      files to bring them into agreement.   Except  in  rare  cir-
  86.      cumstances,  diff finds a smallest sufficient set of differ-
  87.      ences.  If neither filename1 nor filename2 is  a  directory,
  88.      either may be given as `-', in which case the standard input
  89.      is used.  If filename1 is a directory, a file in that direc-
  90.      tory whose filename is the same as the filename of filename2
  91.      is used (and vice versa).
  92.  
  93.      There are several options for  output  format;  the  default
  94.      output format contains lines of these forms:
  95.  
  96.           n1 a n3,n4
  97.           n1,n2 d n3
  98.           n1,n2 c n3,n4
  99.  
  100.      These lines resemble ed(1)  commands  to  convert  filename1
  101.      into  filename2.   The  numbers after the letters pertain to
  102.      filename2.  In fact, by exchanging a for d and reading back-
  103.      ward one may ascertain equally how to convert filename2 into
  104.      filename1.  As in ed(1), identical pairs, where n1 =  n2  or
  105.      n3 = n4, are abbreviated as a single number.
  106.  
  107.      Following each of these lines come all the  lines  that  are
  108.      affected  in  the  first  file  flagged by `<', then all the
  109.      lines that are affected in the second file flagged by `>'.
  110.  
  111.      If both arguments are directories, diff sorts  the  contents
  112.      of  the  directories by name, and then runs the regular file
  113.      diff program as described above on text files which are dif-
  114.      ferent.   Binary  files which differ, common subdirectories,
  115.      and files which appear in only one directory are listed.
  116.  
  117. OPTIONS
  118.      -b   Ignore trailing blanks (SPACE and TAB  characters)  and
  119.           treat all other strings of blanks as equivalent.
  120.  
  121.      -i   Ignore the case of letters; for example, `A' will  com-
  122.           pare equal to `a'.
  123.  
  124.      -t   Expand TAB characters in output lines.   Normal  or  -c
  125.           output  adds  character(s)  to  the  front of each line
  126.           which may alter the indentation of the original  source
  127.           lines  and  make the output listing difficult to inter-
  128.           pret.  This option will preserve the original  source's
  129.           indentation.
  130.  
  131.      -w   Ignore all blanks (SPACE and TAB characters); for exam-
  132.           ple, `if ( a == b )' will compare equal to `if(a==b)'.
  133.  
  134.      The following four options are mutually exclusive:
  135.  
  136.      -c[#]
  137.           Produce a listing of differences with lines of context.
  138.           The default is to present 3 lines of context and may be
  139.           changed, (to 10, for example), by -c10.   With  -c  the
  140.           output format is modified slightly:  output begins with
  141.           identification of the files involved and their creation
  142.           dates,  then  each change is separated by a line with a
  143.           dozen *s.  The lines removed from filename1 are  marked
  144.           with  `-  ';  those added to filename2 are marked `+ '.
  145.           Lines which are changed from one file to the other  are
  146.           marked in both files with `! '.
  147.  
  148.           Changes which lie within <context> lines of each  other
  149.           are  grouped together on output.  This is a change from
  150.           the previous `diff -c' but the resulting output is usu-
  151.           ally much easier to interpret.
  152.  
  153.      -e   Produce a script of a, c, and d commands for the editor
  154.           ed, which will recreate filename2 from filename1.
  155.  
  156.           In connection with -e, the following shell program  may
  157.           help  maintain  multiple  versions  of a file.  Only an
  158.           ancestral file ($1) and a chain  of  version-to-version
  159.           ed scripts ($2,$3,...) made by diff need be on hand.  A
  160.           `latest version' appears on the standard output.
  161.  
  162.                (shift; cat $*; echo '1,$p') | ed - $1
  163.  
  164.           Extra commands are added to the output  when  comparing
  165.           directories  with -e, so that the result is a sh script
  166.           for converting text files which are common to  the  two
  167.           directories  from  their  state  in directory1 to their
  168.           state in directory2.
  169.  
  170.      -f   Produce a script similar to that of -e, not useful with
  171.           ed, which is in the opposite order.
  172.  
  173.      -n   Produce a script similar to that  of  -e,  but  in  the
  174.           opposite  order  and  with  a count of changed lines on
  175.           each insert or delete command.
  176.  
  177.      -h   Do a  fast,  half-hearted  job.   It  works  only  when
  178.           changed  stretches  are  short  and well separated, but
  179.           does work on files of unlimited length.
  180.  
  181.      Options for the second form of diff are as follows:
  182.  
  183.      -Dstring
  184.           Create a merged version of filename1 and  filename2  on
  185.           the  standard  output,  with  C  preprocessor  controls
  186.           included so that a compilation of  the  result  without
  187.           defining  string  is equivalent to compiling filename1,
  188.           while defining string will yield filename2.
  189.  
  190.      Options when comparing directories are:
  191.  
  192.      -l   Long output  format;  each  text  file  diff  is  piped
  193.           through  pr(1V)  to  paginate it, other differences are
  194.           remembered and summarized after all text  file  differ-
  195.           ences are reported.
  196.  
  197.      -r   Apply diff recursively to common subdirectories encoun-
  198.           tered.
  199.  
  200.      -s   Report files which are the same,  which  are  otherwise
  201.           not mentioned.
  202.  
  203.      -Sname
  204.           Start a directory diff in the  middle,  beginning  with
  205.           file name.
  206.  
  207. ENVIRONMENT
  208.      The environment variables  LC_CTYPE,  LANG,  and  LC_default
  209.      control  the  character  classification throughout diff.  On
  210.      entry to diff, these environment variables  are  checked  in
  211.      the following order: LC_CTYPE, LANG, and LC_default.  When a
  212.      valid value is found, remaining  environment  variables  for
  213.      character  classification  are  ignored.  For example, a new
  214.      setting for LANG does not override the current valid charac-
  215.      ter  classification  rules  of  LC_CTYPE.   When none of the
  216.      values is valid, the shell character classification defaults
  217.      to the POSIX.1 "C" locale.
  218.  
  219. FILES
  220.      /tmp/d?????
  221.      /usr/lib/diffh      for -h
  222.  
  223. SEE ALSO
  224.      cc(1V), cmp(1), comm(1), cpp(1), diff3(1V),  ed(1),  pr(1V),
  225.      locale(5), iso_8859_1(7)
  226.  
  227. DIAGNOSTICS
  228.      Exit status is 0 for no differences, 1 for some differences,
  229.      2 for trouble.
  230.  
  231.      Missing newline at end of fileX
  232.           Indicates that the last line of file X did not  have  a
  233.           NEWLINE.  If  the  lines  are  different,  they will be
  234.           flagged and output, although the output  will  seem  to
  235.           indicate they are the same.
  236.  
  237. BUGS
  238.      Editing scripts produced under the -e or -f option are naive
  239.      about creating lines consisting of a single `.'.
  240.  
  241.      When comparing directories with the -b, -w,  or  -i  options
  242.      specified,  diff first compares the files (as in cmp(1), and
  243.      then runs the regular diff algorithm if they are not  equal.
  244.      This  may  cause  a  small  amount of spurious output if the
  245.      files then turn out to be identical because the only differ-
  246.      ences are insignificant blank string or case differences.
  247.  
  248.      The -D option ignores existing preprocessor controls in  the
  249.      source  files,  and  can generate #ifdefs's with overlapping
  250.      scope.  The output should be checked by hand, or run through
  251.      `cc  -E'  (see  cc(1V))  and  then  diffed with the original
  252.      source files.  Discrepancies revealed  should  be  corrected
  253.      before compilation.
  254.  
  255.  
  256. Enter Unix command line:
  257.  
  258. Usage: diff [-#] [-abBcdefhHilnNprstTuvw] [-C lines] [-F regexp] [-I regexp]
  259.        [-L label [-L label]] [-S file] [-D symbol] [+ignore-blank-lines]
  260.        [+context[=lines]] [+unified[=lines]] [+ifdef=symbol]
  261.        [+show-function-line=regexp]
  262.        [+speed-large-files] [+ignore-matching-lines=regexp] [+new-file]
  263.        [+initial-tab] [+starting-file=file] [+text] [+all-text] [+ascii]
  264.        [+minimal] [+ignore-space-change] [+ed] [+reversed-ed] [+ignore-case]
  265.        [+print] [+rcs] [+show-c-function] [+binary] [+brief] [+recursive]
  266.        [+report-identical-files] [+expand-tabs] [+ignore-all-space]
  267.        [+file-label=label [+file-label=label]] [+version] path1 path2
  268.  
  269.  
  270. _________________________________________________________________
  271.  
  272. Author: Vince Darley
  273.  
  274. E-mail: <vince@santafe.edu>
  275.   mail: 317 Paseo de Peralta
  276.         Santa Fe, NM 87501, USA
  277.    www: <http://www.santafe.edu/~vince/>
  278.  
  279.  
  280.